package com.czxy.service;

import com.czxy.dao.UserMapper;
import com.czxy.domain.User;
import com.czxy.domain.UserVo;
import com.czxy.utils.MybatisUtil;

import java.text.ParseException;
import java.util.Date;
import java.util.List;

public class UserService {

    public  User findUserByUid(Integer uid){

        UserMapper mapper = MybatisUtil.getMapper(UserMapper.class);
        User user = mapper.findUserByUid(uid);
        MybatisUtil.close();
        return user;
    }













    public  List<User>  findUsersByUserVo(UserVo userVo) throws ParseException {

        UserMapper mapper = MybatisUtil.getMapper(UserMapper.class);


        List<User> list = mapper.findUsersByUserVo(userVo);


        MybatisUtil.close();


        return list;















    }


    public  List<User> findUsers(Date startTime , Date endTime ,String user_name) throws ParseException {

        UserMapper mapper = MybatisUtil.getMapper(UserMapper.class);


        List<User> list = mapper.findUsers(startTime, endTime, user_name);


        MybatisUtil.close();

        return list;















    }












    public List<User> findAll(){

        UserMapper mapper = MybatisUtil.getMapper(UserMapper.class);

        List<User> list = mapper.findAll();

        MybatisUtil.close();

        return list;
    }
}
